Systems and methods for optimized route caching

ABSTRACT

A method for optimized route caching includes comparing a destination address of a network packet to a first set of prefixes in a routing cache, and comparing the destination address to a second set of prefixes in a full routing table when a longest matching prefix for the destination address is not found in the routing cache. The method further includes copying the longest matching prefix and a set of sub-prefixes of the longest matching prefix from the full routing table to the routing cache, and forwarding the network packet.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.12/207,166 filed Sep. 9, 2008, which is hereby incorporated by referencein its entirety.

FIELD OF THE DISCLOSURE

The present disclosure generally relates to communications networks, andmore particularly relates to systems and methods for optimized routecaching.

BACKGROUND

For Internet traffic to reach its destination, routers along the wayneed to make informed decisions about the path the traffic shouldfollow. This requires the routers to maintain routing information fornumerous Internet Protocol (IP) addresses. Additionally, through theallocation of additional IP addresses, the global routing table isgrowing, increasing the memory required to store the routing table. Inorder to maintain a high rate of traffic through a given router, accessto the routing information and decisions about the next stop along thepath need to occur rapidly, requiring relatively expensive high-speedmemory for storing the routing table.

BRIEF DESCRIPTION OF THE DRAWINGS

It will be appreciated that for simplicity and clarity of illustration,elements illustrated in the Figures have not necessarily been drawn toscale. For example, the dimensions of some of the elements areexaggerated relative to other elements. Embodiments incorporatingteachings of the present disclosure are shown and described with respectto the drawings presented herein, in which:

FIG. 1 is a diagram illustrating an embodiment of a communicationsnetwork;

FIG. 2 is a block diagram illustrating an exemplary system for routingtraffic through a communications network;

FIG. 3 is a flow diagram illustrating an exemplary method for routingtraffic;

FIG. 4 is a flow diagram illustrating another exemplary method forrouting traffic; and

FIG. 5 is an illustrative embodiment of a general computer system.

The use of the same reference symbols in different drawings indicatessimilar or identical items.

DETAILED DESCRIPTION OF THE DRAWINGS

The numerous innovative teachings of the present application will bedescribed with particular reference to the presently preferred exemplaryembodiments. However, it should be understood that this class ofembodiments provides only a few examples of the many advantageous usesof the innovative teachings herein. In general, statements made in thespecification of the present application do not necessarily limit any ofthe various claimed inventions. Moreover, some statements may apply tosome inventive features but not to others.

FIG. 1 shows an illustrative communications network, generallydesignated 100. Communications network 100 can be an autonomous systemor a high capacity core network. Communications network 100 can includea plurality of network nodes 102 through 122. For example, network node102 can be an Internet core router. Pairs of network nodes 102 through122 can be connected by network links 124 through 150. For example,network node 102 can be connected to network node 104 though networklink 124. Network links 124 through 150 can be fiber optic, coaxialcable, copper twisted-pair, or wireless connections.

Each network link has a network capacity that limits the amount oftraffic that can travel through the network link. In an exemplaryembodiment, the network links 124 through 150 can be high capacitylinks, such as 10 Gb/s fiber optic connections. Alternatively, the linkcapacity can be higher or lower than 10 Gb/s. When the amount of trafficexceeds the link capacity, the network link can become congested. Duringlimited periods of congestion, traffic can be queued at the networknode. However, the queuing capacity can be limited, resulting in networkpackets being dropped during extended periods of congestion.

In order for network packets to reach their destination, traffic nodes102 through 122 can determine the next hop for each network packet. Thenext hop can be determined based on the destination address of thenetwork packet and a forwarding information base (FIB). The FIB caninclude classless inter-domain routing (CIDR) prefixes for each subnetin the network, as well as preferred next hop information correspondingto each CIDR prefix. When determining the next hop for a network packet,the destination address can be compared to the prefixes in the FIB tofind a subnet to which the destination belongs. The network packet canbe directed to the preferred next hop for that subnet. When thedestination address matches multiple prefixes in the FIB, the longestmatching prefix (LMP) is used. For example, when the FIB includes theprefixes 12.5/16 and 12.5.1/24, 12.5.1/24 can be the LMP for thedestination address 12.5.1.10 and 12.5/16 can be the LMP for thedestination address 12.5.2.52.

FIG. 2 shows a block diagram illustrating a system 200 for routing IPtraffic. The system can include a full routing table 202, a routingcache 204, a traffic flow module 206, and an intermediary module 208.Each of the full routing table 202, the routing cache 204, the trafficflow module 206, and the intermediary module 208 can be implemented inhardware, software, or any combination thereof.

The full routing table 202 can include a FIB. The FIB includes aplurality of CIDR prefixes and a preferred route for each CIDR prefix.The routing cache 204 can include a subset of the CIDR prefixes in theFIB and the associated preferred routes. The subset of CIDR prefixes caninclude prefixes that have recently been used to forward traffic. When anetwork packet having a destination address is received, an LMP and thecorresponding preferred route can be copied from the full routing table202 to the routing cache 204. When the routing cache 204 is full,prefixes may be evicted from the routing cache 204. The prefixes may beevicted according to a least recently used (LRU) algorithm, a leastfrequently used (LFU) algorithm, or other type of cache algorithm. TheLRU algorithm can track the last time a prefix in the cache was used toroute a packet, and can evict the prefix with a last used time furthestin the past. The LFU algorithm can track the number of times a prefix inthe cache is used to route a packet, and can evict the prefix that hasbeen used the smallest number of times. Additionally, when there aremultiple prefixes matching the eviction criteria, the routing cache 204can evict the least specific or shortest prefix. In an embodiment, if alonger, more specific sub-prefix was evicted from the cache prior toevicting the shorter, less specific prefix, a network packet to thesub-prefix may be incorrectly routed based on the preferred routeassociated with prefix.

The traffic flow module 206 can direct incoming traffic 210 to one of aplurality of out interfaces 212 and 214 based on the preferred routeassociated with the LMP of the destination address. The traffic flowmodule 206 can include a queue 216 for temporarily holding networkpackets. The queue 216 can be a first in, first out queue. Networkpackets may be placed in queue 216 when there is a delay in forwardingthe network packet to the next hop, such as when the appropriate outinterface 212 or 214 is congested, or when an LMP is not currently inthe routing cache 204 requiring a look-up in the full routing table 202.When the queue is full, adding an additional network packet to the queuecan cause a packet to be dropped. In another embodiment, the packet maybe dropped when the LMP is not in the routing cache 204.

In yet another embodiment, when the LMP is not in the routing cache 204,the traffic flow module 206 can forward the network packet to theintermediary module 208. The intermediary module 208 can have relativelyfast access to the full routing table 202. When the intermediary module208 receives a network packet from traffic flow module 206, theintermediary module 208 can route the network packet based on thepreferred route associated with the LMP in the full routing table 202.

FIG. 3 is a flow diagram illustrating an exemplary method for routingtraffic utilizing a routing cache. At 302, a network packet can bereceived. The network packet can include a destination address. At 304,the destination address can be compared to the prefixes stored in therouting cache.

When a prefix matching the destination address is not found in therouting cache, the network packet can be placed in the queue, asillustrated at 306. At 308, the destination address can be compared tothe prefixes in the full routing table to find an LMP corresponding tothe destination address, and, at 310, the LMP can be copied from thefull routing table to the routing cache. At 312, a set of additionalprefixes can be copied from the full routing table to the routing cache.The set of additional prefixes can include sub-prefixes of the LMP. Forexample, if the full routing table includes the prefix 12.5/16 and12.5.1/24, then 12.5.1/24 can be a sub-prefix of 12.5/16 and can becopied to the routing cache along with 12.5/16. At 314, the networkpacket can be removed from the queue and forwarded to the next hop basedon the preferred routing information associated with the LMP. At 302,another network packet can be received.

In an exemplary embodiment, the set of additional prefixes can includeevery sub-prefix of the LMP. In another embodiment, the set ofadditional prefixes can include only those sub-prefixes associated withan output port different from the output port associated with the LMP.For example, the full routing table can include the prefix 12.5/16 andthe sub-prefixes 12.5.1/24 and 12.5.2/24. 12.5/16 and 12.5.2/24 can beassociated with output port 1, and 12.5.1/24 can be associated withoutput port 2. When the prefix 12.5/16 is the LMP, only the preferredroute for 12.5/16 and 12.5.1/24 can be copied to the routing cache.

In a further embodiment, the set of additional prefixes can include oneor more special-purpose prefixes that are sub-prefixes of the LMP, andthat can instruct the traffic flow module to check the full routingtable for the preferred router. In this way, the special-purpose prefixcan represent all multiple sub-prefixes, even if the sub-prefixes areassociated with different output ports, thereby reducing the number ofsub-prefixes copied to the routing cache. For example, the full routingtable can include the LMP 12/8 and the sub-prefixes 12.5/16, 12.5.1/24,and 12.5.2/24. A special-purpose prefix 12.5/16 instructing a look-up onthe full routing table can be placed in the routing cache along with theLMP 12/8. When a second packet having a destination address of12.5.2.156 arrives, the traffic flow module can check the routing cache.The LMP in the routing cache for the second packet can be thespecial-purpose prefix 12.5/16, and the traffic flow module can checkthe full routing table for the preferred route. The preferred route forthe sub-prefix 12.5.2/24 can be copied into the routing cache.Subsequent packets destined for the 12.5.2/24 sub-prefix can match the12.5.2/24 sub-prefix in the routing cache and may not require looking inthe full routing table.

In yet another embodiment, multiple contiguous prefixes in the cachethat are associated with the same output port can be merged into asingle super-prefix. For example, the full routing table can include theLMP 12.5/16 associated with output port 1 and the sub-prefixes 12.5.2/24and 12.5.3/24 associated with an output port 2. The sub-prefixes12.5.2/24 and 12.5.3/24 may have the same next hop or output port butdifferent down-stream routes, causing them to be separate in the fullrouting table. When the LMP 12.5/16 is copied to the routing cache, thesub-prefixes 12.5.2/24 and 12.5.3/24 can be combined into a super-prefix12.5.2/23 associated with output port 2 and the super-prefix can becopied into the routing cache.

Alternatively, when a prefix matching the destination address is foundin the routing cache, the cache can be updated at 316. Updating thecache can include incrementing the number of times the prefix has beenused, or changing the last used time for the prefix. In an embodiment,all sub-prefixes of the LMP can also be updated. In this way, a longer,more specific sub-prefix cannot be eligible for eviction prior to ashorter, less specific prefix. In an embodiment, if the sub-prefix wereevicted from the cache prior to evicting the prefix, a network packet tothe sub-prefix may be incorrectly routed based on the preferred routeassociated with prefix. At 314, the network packet can be forwardedbased on the next hop information in the routing cache, and anothernetwork packet can be received, as illustrated at 302.

FIG. 4 is a flow diagram illustrating an exemplary method for routingtraffic utilizing a routing cache. At 402, the traffic flow module canreceive a network packet. The network packet can include a destinationaddress. At 404, the destination address can be compared to the prefixesstored in the routing cache. When an LMP matching the destinationaddress is found in the routing cache, the cache can be updated at 406.Updating the cache can include incrementing the number of times theprefix has been used, or changing the last used time for the prefix. Inan embodiment, all sub-prefixes of the LMP can also be updated. At 408,the network packet can be routed based on the preferred routeinformation associated with the LMP in the routing cache. At 402,another network packet can be received.

Alternatively, when a prefix matching the destination address is notfound in the routing cache, the network packet can be forwarded to anintermediary, as illustrated at 410. At 412, the destination address canbe compared to the prefixes in the full routing table to find an LMPcorresponding to the destination address, and, at 414, the LMP can becopied from the full routing table to the routing cache. At 416, a setof additional prefixes can be copied from the full routing table to therouting cache. The set of additional prefixes can include sub-prefixesof the LMP, as previously discussed. At 402, another network packet canbe received.

FIG. 5 shows an illustrative embodiment of a general computer system500. The computer system 500 can include a set of instructions that canbe executed to cause the computer system to perform any one or more ofthe methods or computer based functions disclosed herein. The computersystem 500 may operate as a standalone device or may be connected, suchas by using a network, to other computer systems or peripheral devices.

In a networked deployment, the computer system may operate in thecapacity of a server or as a client user computer in a server-clientuser network environment, or as a peer computer system in a peer-to-peer(or distributed) network environment. The computer system 500 can alsobe implemented as or incorporated into various devices, such as apersonal computer (PC), a tablet PC, an STB, a personal digitalassistant (PDA), a mobile device, a palmtop computer, a laptop computer,a desktop computer, a communications device, a wireless telephone, aland-line telephone, a control system, a camera, a scanner, a facsimilemachine, a printer, a pager, a personal trusted device, a web appliance,a network router, switch or bridge, or any other machine capable ofexecuting a set of instructions (sequential or otherwise) that specifyactions to be taken by that machine. In a particular embodiment, thecomputer system 500 can be implemented using electronic devices thatprovide voice, video or data communication. Further, while a singlecomputer system 500 is illustrated, the term “system” shall also betaken to include any collection of systems or sub-systems thatindividually or jointly execute a set, or multiple sets, of instructionsto perform one or more computer functions.

The computer system 500 may include a processor 502, such as a centralprocessing unit (CPU), a graphics processing unit (GPU), or both.Moreover, the computer system 500 can include a main memory 504 and astatic memory 506 that can communicate with each other via a bus 508. Asshown, the computer system 500 may further include a video display unit510 such as a liquid crystal display (LCD), an organic light emittingdiode (OLED), a flat panel display, a solid-state display, or a cathoderay tube (CRT). Additionally, the computer system 500 may include aninput device 512 such as a keyboard, and a cursor control device 514such as a mouse. Alternatively, input device 512 and cursor controldevice 514 can be combined in a touchpad or touch sensitive screen. Thecomputer system 500 can also include a disk drive unit 516, a signalgeneration device 518 such as a speaker or remote control, and a networkinterface device 520 to communicate with a network 526. In a particularembodiment, the disk drive unit 516 may include a computer-readablemedium 522 in which one or more sets of instructions 524, such assoftware, can be embedded. Further, the instructions 524 may embody oneor more of the methods or logic as described herein. In a particularembodiment, the instructions 524 may reside completely, or at leastpartially, within the main memory 504, the static memory 506, and/orwithin the processor 502 during execution by the computer system 500.The main memory 504 and the processor 502 also may includecomputer-readable media.

The illustrations of the embodiments described herein are intended toprovide a general understanding of the structure of the variousembodiments. The illustrations are not intended to serve as a completedescription of all of the elements and features of apparatus and systemsthat utilize the structures or methods described herein. Many otherembodiments may be apparent to those of skill in the art upon reviewingthe disclosure. Other embodiments may be utilized and derived from thedisclosure, such that structural and logical substitutions and changesmay be made without departing from the scope of the disclosure.Additionally, the illustrations are merely representational and may notbe drawn to scale. Certain proportions within the illustrations may beexaggerated, while other proportions may be minimized. Accordingly, thedisclosure and the FIGs. are to be regarded as illustrative rather thanrestrictive.

The Abstract of the Disclosure is provided to comply with 37 C.F.R.§1.72(b) and is submitted with the understanding that it will not beused to interpret or limit the scope or meaning of the claims. Inaddition, in the foregoing Detailed Description of the Drawings, variousfeatures may be grouped together or described in a single embodiment forthe purpose of streamlining the disclosure. This disclosure is not to beinterpreted as reflecting an intention that the claimed embodimentsrequire more features than are expressly recited in each claim. Rather,as the following claims reflect, inventive subject matter may bedirected to less than all of the features of any of the disclosedembodiments. Thus, the following claims are incorporated into theDetailed Description of the Drawings, with each claim standing on itsown as defining separately claimed subject matter.

The above disclosed subject matter is to be considered illustrative, andnot restrictive, and the appended claims are intended to cover all suchmodifications, enhancements, and other embodiments which fall within thetrue spirit and scope of the present disclosed subject matter. Thus, tothe maximum extent allowed by law, the scope of the present disclosedsubject matter is to be determined by the broadest permissibleinterpretation of the following claims and their equivalents, and shallnot be restricted or limited by the foregoing detailed description.

What is claimed is:
 1. A system, comprising: a memory that storesinstructions; a processor that executes the instructions to performoperations, the operations comprising: comparing, when a longestmatching prefix of a destination address of a network packet is notfound in a routing cache, the destination address of the network packetto a first set of prefixes in a full routing table; copying, when thelongest matching prefix of the destination address is found in the fullrouting table and not found in the routing cache, the longest matchingprefix from the full routing table to the routing cache; copying, fromthe full routing table to the routing cache, a sub-prefix of the longestmatching prefix, wherein the sub-prefix is a special-purpose prefix thatrepresents a plurality of sub-prefixes having different output ports;and forwarding the network packet based on a preferred route obtainedbased on the sub-prefix.
 2. The system of claim 1, wherein theoperations further comprise comparing the destination address of thenetwork packet to a second set of prefixes in the routing cache.
 3. Thesystem of claim 1, wherein the operations further comprise performing alook-up on the full routing table based on the sub-prefix.
 4. The systemof claim 1, wherein the operations further comprise copying thepreferred route to the routing cache.
 5. The system of claim 1, whereinthe operations further comprise placing the network packet in a queuewhen the longest matching prefix of the destination address of thenetwork packet is not found in the routing cache.
 6. The system of claim1, wherein the operations further comprise updating the routing cache byincrementing a quantity of times the longest matching prefix has beenused.
 7. The system of claim 1, wherein the operations further compriseevicting a least frequently used prefix from the routing cache when therouting cache is full.
 8. The system of claim 1, wherein the operationsfurther comprising evicting a least recently used prefix from therouting cache when the routing cache is full.
 9. The system of claim 1,wherein the operations further comprise copying, from the full routingtable to the routing cache, a different sub-prefix of the longestmatching prefix, wherein the different sub-prefix does not have a sameoutput interface as the longest matching prefix.
 10. The system of claim1, wherein the operations further comprise merging a plurality ofcontiguous sub-prefixes of the longest matching prefix into asuper-prefix.
 11. The system of claim 10, wherein the operations furthercomprise inserting the super-prefix as a single entry in the routingcache.
 12. A method, comprising: comparing, when a longest matchingprefix of a destination address of a network packet is not found in arouting cache, the destination address of the network packet to a firstset of prefixes in a full routing table, wherein the comparing isperformed by utilizing instructions from memory that are executed by aprocessor; copying, when the longest matching prefix of the destinationaddress is found in the full routing table and not found in the routingcache, the longest matching prefix from the full routing table to therouting cache; copying, from the full routing table to the routingcache, a sub-prefix of the longest matching prefix, wherein thesub-prefix is a special-purpose prefix that represents a plurality ofsub-prefixes having different output ports; and forwarding the networkpacket based on a preferred route obtained based on the sub-prefix. 13.The method of claim 12, further comprising forwarding the network packetto a next hop based on the preferred route obtained based on thesub-prefix.
 14. The method of claim 12, further comprising forwardingthe network packet to an intermediary when the longest matching prefixof the destination address is not found in the routing cache.
 15. Themethod of claim 14, further comprising forwarding the network packetfrom the intermediary based on the preferred route.
 16. The method ofclaim 12, further comprising evicting a least frequently used prefixfrom the routing cache when the routing cache is full.
 17. The method ofclaim 12, further comprising copying, from the full routing table to therouting cache, a different sub-prefix of the longest matching prefix,wherein the different sub-prefix does not have a same output interfaceas the longest matching prefix.
 18. The method of claim 12, furthercomprising merging a plurality of contiguous sub-prefixes of the longestmatching prefix into a super-prefix.
 19. The method of claim 12, furthercomprising placing the network packet in a queue when the longestmatching prefix of the destination address of the network packet is notfound in the routing cache.
 20. A computer-readable device comprisinginstructions, which, when loaded and executed by a processor, cause theprocessor to perform operations, the operations comprising: comparing,when a longest matching prefix of a destination address of a networkpacket is not found in a routing cache, the destination address of thenetwork packet to a first set of prefixes in a full routing table;copying, when the longest matching prefix of the destination address isfound in the full routing table and not found in the routing cache, thelongest matching prefix from the full routing table to the routingcache; copying, from the full routing table to the routing cache, asub-prefix of the longest matching prefix, wherein the sub-prefix is aspecial-purpose prefix that represents a plurality of sub-prefixeshaving different output ports; and forwarding the network packet basedon a preferred route obtained based on the sub-prefix.